/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package afroschool.beans;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author AUTRES
 */
@Entity
@Table(name = "etablissement")
@NamedQueries({@NamedQuery(name = "Etablissement.findByCode", query = "SELECT e FROM Etablissement e WHERE e.code = :code"), @NamedQuery(name = "Etablissement.findByIdAdresse", query = "SELECT e FROM Etablissement e WHERE e.idAdresse = :idAdresse"), @NamedQuery(name = "Etablissement.findByName", query = "SELECT e FROM Etablissement e WHERE e.name = :name"), @NamedQuery(name = "Etablissement.findByTelephone", query = "SELECT e FROM Etablissement e WHERE e.telephone = :telephone"), @NamedQuery(name = "Etablissement.findByFax", query = "SELECT e FROM Etablissement e WHERE e.fax = :fax"), @NamedQuery(name = "Etablissement.findByCodepostal", query = "SELECT e FROM Etablissement e WHERE e.codepostal = :codepostal"), @NamedQuery(name = "Etablissement.findByCity", query = "SELECT e FROM Etablissement e WHERE e.city = :city"), @NamedQuery(name = "Etablissement.findByCountry", query = "SELECT e FROM Etablissement e WHERE e.country = :country")})
public class Etablissement implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "code", nullable = false)
    private String code;
    @Column(name = "idAdresse")
    private Integer idAdresse;
    @Column(name = "name")
    private String name;
    @Column(name = "telephone")
    private String telephone;
    @Column(name = "fax")
    private String fax;
    @Column(name = "codepostal")
    private String codepostal;
    @Column(name = "city")
    private String city;
    @Column(name = "country")
    private String country;

    public Etablissement() {
    }

    public Etablissement(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getIdAdresse() {
        return idAdresse;
    }

    public void setIdAdresse(Integer idAdresse) {
        this.idAdresse = idAdresse;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getCodepostal() {
        return codepostal;
    }

    public void setCodepostal(String codepostal) {
        this.codepostal = codepostal;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (code != null ? code.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Etablissement)) {
            return false;
        }
        Etablissement other = (Etablissement) object;
        if ((this.code == null && other.code != null) || (this.code != null && !this.code.equals(other.code))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "afroschool.beans.Etablissement[code=" + code + "]";
    }

}
